package com.magicsoft.share.adapter.my;

import android.support.annotation.LayoutRes;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.my.Address;

/**
 * Created by lyf on 2017/11/8/008.
 */

public class AddressAdapter extends BaseQuickAdapter<Address,BaseViewHolder> {
    public AddressAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, Address item) {
        helper.addOnClickListener(R.id.tv_edit).addOnClickListener(R.id.tv_delete).addOnClickListener(R.id.radio);
        helper
                .setText(R.id.tv_name,"收货人："+item.getApp_user_name())
                .setText(R.id.tv_mobile,item.getPhone())

                .setText(R.id.tv_address,"收货地址："+item.getAddress_detail());
        if (item.getWhether_default()==1){
            helper.setChecked(R.id.radio,true);
        }else {
            helper.setChecked(R.id.radio,false);
        }


    }
}
